//
//  SlideTabContainerController.h
//  LotteryClient
//
//  Created by SunYu-Mac on 14-2-21.
//  Copyright (c) 2014年 SunYu. All rights reserved.
//

/**
 
 
 使用方法
 SlideTabContainerController *viewController = [[SlideTabContainerController alloc] init];
 
 UIViewController *viewController1 = [[UIViewController alloc] init];
 viewController1.title = @"A--m";
 viewController1.view.backgroundColor = [UIColor blackColor];
 
 UIViewController *viewController3 = [[UIViewController alloc] init];
 viewController3.title = @"c--m";
 
 UIViewController *viewController2 = [[UIViewController alloc] init];
 viewController2.title = @"N--b";
 viewController2.view.backgroundColor = [UIColor grayColor];
 
 viewController.viewControllers = [NSMutableArray arrayWithObjects:viewController1,viewController3,viewController2,nil];
 
 **/
#import "SlideTabInfoMedol.h"
#import <UIKit/UIKit.h>
#import "BaseViewController.h"
@protocol SlideTabContainerControllerDelegate;

@interface SlideTabContainerController : BaseViewController  <UIScrollViewDelegate>
{
    UIScrollView *_rootScrollView;                  //主视图
    UIScrollView *_topScrollView;                   //顶部页签视图

    CGFloat _userContentOffsetX;
    BOOL _isLeftScroll;                             //是否左滑动
    BOOL _isRootScroll;                             //是否主视图滑动
    BOOL _isBuildUI;                                //是否建立了ui

    NSInteger _userSelectedChannelID;               //点击按钮选择名字ID

	NSInteger _selectIndex;
    UIImageView *_shadowImageView;
    UIImage *_shadowImage;

    UIColor *_tabItemNormalColor;                   //正常时tab文字颜色
    UIColor *_tabItemSelectedColor;                 //选中时tab文字颜色
    UIImage *_tabItemNormalBackgroundImage;         //正常时tab的背景
    UIImage *_tabItemSelectedBackgroundImage;       //选中时tab的背景
    NSMutableArray *_viewControllers;                     //主视图的子视图数组

    UIButton *_rigthSideButton;                     //右侧按钮
}

@property (nonatomic, strong)NSMutableArray<SlideTabInfoMedol> *tabInfoArray;


@property (nonatomic, assign)BOOL isShowTabTitle;
@property (nonatomic, assign)BOOL switchAnimate;

@property (nonatomic, strong)  UIScrollView *rootScrollView;
@property (nonatomic, strong)  UIScrollView *topScrollView;
@property (nonatomic, assign)  CGFloat userContentOffsetX;
@property (nonatomic, assign)  NSInteger userSelectedChannelID;
@property (nonatomic, assign)  NSInteger scrollViewSelectedChannelID;
@property (nonatomic, strong) UIColor *tabItemNormalColor;
@property (nonatomic, strong) UIColor *tabItemSelectedColor;
@property (nonatomic, strong) UIImage *tabItemNormalBackgroundImage;
@property (nonatomic, strong) UIImage *tabItemSelectedBackgroundImage;
@property (nonatomic, strong) UIImage *shadowImage;

@property (nonatomic, strong) UIButton *rigthSideButton;


@property (nonatomic,assign)NSInteger selectIndex;

@property (nonatomic, assign) id<SlideTabContainerControllerDelegate> slideSwitchViewDelegate;

@end

@protocol SlideTabContainerControllerDelegate <NSObject>

@optional

/*!
 * @method 滑动左边界时传递手势
 * @abstract
 * @discussion
 * @param   手势
 * @result
 */
- (void)slideSwitchView:(SlideTabContainerController *)controller panLeftEdge:(UIPanGestureRecognizer*) panParam;

/*!
 * @method 滑动右边界时传递手势
 * @abstract
 * @discussion
 * @param   手势
 * @result
 */
- (void)slideSwitchView:(SlideTabContainerController *)controller panRightEdge:(UIPanGestureRecognizer*) panParam;

/*!
 * @method 点击tab
 * @abstract
 * @discussion
 * @param tab索引
 * @result
 */
- (void)slideSwitchView:(SlideTabContainerController *)controller didselectTab:(NSUInteger)number;
@end

